package com.xxpn.controller.client;

import java.io.ObjectInputStream;
import java.net.Socket;

public class ClientLisen implements Runnable {
    private Socket socket;
    private ObjectInputStream ois;

    public ClientLisen(Socket socket){
        this.socket = socket;
    }

    @Override
    public void run() {
        try {
            while (true) {
                ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
                if(ois!=null){
                    System.out.println(ois.readObject());
                }

            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
